/*
// number
let decimal: number = 6;
let hex: number = 0xf00d;
let binary: number = 0b1010;
let octal: number = 0o744;
// @ts-ignore
let big: bigint = 100n;
console.log(decimal);
console.log(hex);
console.log(binary);
console.log(octal);
console.log(big);

// boolean
let isDone: boolean = false;

// string
let colour: string = 'blue';
colour = 'red';
console.log(colour);

let myName: string = 'Alice';
let age: number = 18;
let sentence: string = `Hello, my name is ${myName}.
I'll be ${age + 1} years old next year`;
console.log(sentence);

// 字面量
let colour: 'red' | 'green' | 'blue' = 'green';
let number: 1| 2 | 3 | 4 = 4;
console.log(colour);
console.log(number);

// any
let d: any = 4;
d = 'hello';
d = true;
console.log(d);


// unknown
let noSure: unknown = 4;
noSure = 'hello';
console.log(noSure);

// void
let unusable: void = undefined;
console.log(unusable);

// never
let err = (message: string): never => {
  throw new Error(message);
};
err('未知错误');


// object
let obj: object = {};
console.log(obj);

// array
let list: number[] = [1, 3, 5];
let list1: Array<number> = [2, 4, 6];
console.log(list);
console.log(list1);

// tuple
let x: [string, number] = ['hello', 10];
console.log(x);

// enum
enum Colour {
  RED,
  GREEN,
  BLUE
}
let c: Colour = Colour.GREEN;
console.log(c);   // 1
*/

let someValue: unknown = 'This is a string';
let strLength: number = (someValue as string).length;
console.log(strLength);

let someValue1: unknown = 'This is another string';
let strLength1: number = (<string>someValue1).length;
console.log(strLength1);
